<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>2_类式组件</title>
</head>

<body>
    <div id="test"></div>

    <script type="text/javascript" src="../js/react.development.js"></script>
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <script type="text/javascript" src="../js/babel.min.js"></script>

    <script type="text/babel">

        //创建类式组件
        class ClassComponent extends React.Component{
            render(){
                console.log('render中的this:',this);
                return <h2>我是类式组件【复杂组件】</h2>
            }
        }

        ReactDOM.render(<ClassComponent/>, document.getElementById('test'))

    </script>
</body>
</body>

</html>